<?php

namespace Log;

class LoggerFactory {
	private $loggerManager;
	private $logHandlerManager;

	public function __construct ($g) {
		$this->loggerManager = $g->getLoggerManager();
		$this->logHandlerManager = $g->getLogHandlerManager();
	}

	public function newDefault ($name) {
		$handler = $this->logHandlerManager->getHandler('ConsoleLogHandler');
		$logger = $this->loggerManager->getLogger($name);

		$logger->addHandler($handler);

		return $logger;
	}
}
